<template>
	<view>
		<u-navbar :border-bottom="false" title="设置" title-color="#fff" back-icon-color="#fff"></u-navbar>
		<my-list class="infoList">
			<my-list-item @click="golink('password/alterPassword')" title="修改密码"></my-list-item>
			<my-list-item @click="golink('feedback')" title="意见反馈"></my-list-item>
			<my-list-item title="版本更新" :right-text="version" :showRightArrow="false"></my-list-item>
			<my-list-item @click="about" title="关于"></my-list-item>
		</my-list>
		<view class="quitBtn" @click="quitLogin">退出登录</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			version: '' //版本信息
		};
	},
	onLoad(option) {
		// #ifdef APP-PLUS
		this.version = 'V' + plus.runtime.version;
		// #endif
	},
	methods: {
		about(){
			uni.navigateTo({
				url:'about/about?version='+this.version
			});
		},
		// 跳转链接
		golink(url) {
			uni.navigateTo({
				url: url
			});
		},
		//退出登录
		quitLogin() {
			uni.showLoading({
				title: '退出中...'
			});
			this.updateUser(null).then(() => {
				uni.reLaunch({
					url: '../login/login'
				});
				uni.hideLoading();
			});
			// 		uni.setStorage({
			// 			key: 'user',
			// 			data: null,
			// 			success() {

			// 			}
			// 		});
		}
	}
};
</script>
<style>
page {
	background-color: #f5f5f5;
}
</style>
<style scoped lang="scss">
.quitBtn {
	width: 100%;
	height: 110upx;
	color: #f45c4b;
	font-size: 32upx;
	background: #fff;
	text-align: center;
	line-height: 110upx;
	margin-top: 20upx;
}
</style>
